package com.accountsmanager.action;

import com.accountsmanager.service.LoginService;
import com.opensymphony.xwork2.ActionSupport;

public class LoginAction extends ActionSupport {

	private static final long serialVersionUID = 1L;
	private LoginService loginService;
	
	public String init(){
		return "init";
	}
	
	public String login(){
		
		//ApplicationContext context = new ClassPathXmlApplicationContext("config/common/spring/spring-bean.xml");
		//loginService = (LoginService) context.getBean("loginService");
		System.out.println("login!!!!");
		//loginService.login();
		loginService.addUser("user1", "user1-psw", "user1-name");
		
		return SUCCESS;
	}
	
	public String test(){
		return "test";
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public LoginService getLoginService() {
		return loginService;
	}

	public void setLoginService(LoginService loginService) {
		this.loginService = loginService;
	}
}
